// server.js
const path = require('path');
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');

const app = express();
const PORT = 3000; // 您可以根据需要更改端口

// 设置静态文件目录
app.use(express.static(path.join(__dirname, 'public')));

// 中间件
app.use(cors()); // 允许所有来源的请求
app.use(bodyParser.json()); // 解析 JSON 请求体

// 示例数据（在实际应用中，您可能会从数据库中获取数据）
const healthData = {
    '412726198002052437': {
        height: 175,
        weight: 70,
        bloodPressure: {
            systolic: 120,
            diastolic: 80
        },
        heartRate: 72,
        bloodSugar: 5.5,
        randomBloodSugar: 7.0
    },
    '987654321098765432': {
        height: 160,
        weight: 60,
        bloodPressure: {
            systolic: 130,
            diastolic: 85
        },
        heartRate: 85,
        bloodSugar:4.5,
        randomBloodSugar: 7.2
    }
};

const data_list = {
    '412726198002052437':{
        '2024-04-05':{
            'height': 175,
            'weight': 70,
            'bloodPressure': {
                'systolic': 120,
                'diastolic': 80
            },
            'heartRate': 72,
            'bloodSugar': 5.5,
            'randomBloodSugar': 7.0
        },
        '2024-04-06':{
            'height': 175,
            'weight': 72,
            'bloodPressure': {
                'systolic': 125,
                'diastolic': 82
            },
            'heartRate': 75,
            'bloodSugar': 6.5,
            'randomBloodSugar': 7.2
        }
    },
    '987654321098765432':{
        '2024-04-05':{
            'height': 168,
            'weight': 60,
            'bloodPressure': {
                'systolic': 110,
                'diastolic': 75
            },
            'heartRate': 70,
            'bloodSugar': 5.8,
            'randomBloodSugar': 7.2
        },
        '2024-04-06':{
            'height': 172,
            'weight': 70,
            'bloodPressure': {
                'systolic': 115,
                'diastolic': 72
            },
            'heartRate': 73,
            'bloodSugar': 6.8,
            'randomBloodSugar': 7.1
        }
    }
}

// 定义根路由
app.get('/', (req, res) => {
    res.send(`
      <!DOCTYPE html>
      <html lang="zh">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Express 示例页面</title>
          <link rel="stylesheet" href="/style.css">
          <style>
              body { font-family: Arial, sans-serif; text-align: center; margin-top: 50px; }
              h1 { color: #333; }
          </style>
          
      </head>
      <body>
          <h1>欢迎来到 Express 示例页面！</h1>
          

          <ul class="detail_ehr">
           
            <li class="width20">
                <p>
                    <label>档案状态：</label>正常&nbsp;</p>
                <p>
                    <label>本人电话：</label>18928875901</p>
                <p>
                    <label>身份证号：</label>440105195308020932</p>
            </li>
  
          </ul>


          <form class="x-panel-body x-panel-body-noborder x-form" method="POST" id="ext-gen1451" style="overflow: auto; width: auto; height: 900px;">
    <div class="my">
        <input id="recordId_O4EBN" name="recordId" type="hidden" title="检查单号">
        <table width="960" cellpadding="0" cellspacing="0" border="0" id="info_tables2">
            <tbody>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">备注</strong></td>
                    <td colspan="3">
                        <input type="text" name="bz" class="input_btline" id="bz_O4EBN" size="56">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">实际随访日期</strong></td>
                    <td colspan="3" align="left" class="info_tables">
                        <div id="div_visitDate_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1476" style="width: 310px;">
                                <input type="text" size="10" autocomplete="off" id="ext-comp-1252" name="visitDate_O4EBN" class="x-form-text x-form-field" style="width: 285px;"><img src="" alt="" class="x-form-trigger x-form-date-trigger" id="ext-gen1477"></div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">随访方式</strong></td>
                    <td colspan="3">
                        <div id="div_visitWay_O4EBN" class=" " title="">
                            <label>
                                <input type="radio" value="1" name="visitWay_O4EBN"><font>门诊就诊&nbsp;</font></label>
                            <label>
                                <input type="radio" value="3" name="visitWay_O4EBN"><font>家庭随访&nbsp;</font></label>
                            <label>
                                <input type="radio" value="5" name="visitWay_O4EBN"><font>电话随访</font></label>
                        </div>
                    </td>
                </tr>
                <tr class="info_tables">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">转归</strong></td>
                    <td>
                        <div id="div_visitEffect_O4EBN" class=" x-form-invalid" title="转归为必填项">
                            <label>
                                <input type="radio" value="1" id="visitEffect_continue_O4EBN" name="visitEffect_O4EBN"><font>继续随访&nbsp;</font></label>
                            <label>
                                <input type="radio" value="2" id="visitEffect_temporary_O4EBN" name="visitEffect_O4EBN"><font>暂时失访&nbsp;</font></label>
                            <label>
                                <input type="radio" value="9" id="visitEffect_termination_O4EBN" name="visitEffect_O4EBN"><font>终止管理 </font></label>
                        </div>
                    </td>
                    <td colspan="3"><span id="ZGYY_O4EBN" style="color: black;">&nbsp;&nbsp;&nbsp;&nbsp; 原因：</span>
                        <div id="div_noVisitReason_O4EBN" style="display: inline;" title="原因">
                            <label>
                                <input type="radio" name="noVisitReason_O4EBN" id="noVisitReason_1_O4EBN" value="1" onclick="onVisitReasonChange(value)"><font>死亡&nbsp;</font></label>
                            <label>
                                <input type="radio" name="noVisitReason_O4EBN" id="noVisitReason_2_O4EBN" value="2" onclick="onVisitReasonChange(value)"><font>迁出&nbsp;</font></label>
                            <label>
                                <input type="radio" name="noVisitReason_O4EBN" id="noVisitReason_3_O4EBN" value="3" onclick="onVisitReasonChange(value)"><font>失访&nbsp;</font></label>
                            <label>
                                <input type="radio" name="noVisitReason_O4EBN" id="noVisitReason_4_O4EBN" value="4" onclick="onVisitReasonChange(value)"><font>拒绝</font></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">症状</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="checkbox" value="1" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value,otherSymptoms_O4EBN)"><font>无症状&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="2" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>头痛头晕&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="3" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>恶心呕吐&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="4" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>眼花耳鸣&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="5" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>呼吸困难&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="6" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>心悸胸闷&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="7" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>鼻衄出血不止&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="8" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>四肢发麻&nbsp;</font></label>
                        <label>
                            <input type="checkbox" value="9" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value)"><font>下肢水肿</font></label>
                        <br>
                        <label>
                            <input type="checkbox" value="10" id="currentSymptoms_10_O4EBN" name="currentSymptoms_O4EBN" onclick="onCurrentSymptomsClick(value,otherSymptoms_O4EBN)"><font>其他&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></label>其他症状:
                        <input type="text" class="input_btline" id="otherSymptoms_O4EBN" size="56" title="其他症状" disabled="">
                    </td>
                </tr>
                <tr>
                    <td width="10%" rowspan="6" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">体征</strong></td>
                    <td align="center" style="font-weight:bold;">血压（mmHg）</td>
                    <td>
                        <input type="text" name="constriction" id="constriction_O4EBN" class="input_btline width120 x-form-invalid" size="5" onchange="onXYChange(constriction_O4EBN,diastolic_O4EBN)" value="收缩压" onkeyup="value=this.value.replace(/[^0-9]/g,'')"
                        onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="收缩压(mmHg)为必填项">/
                        <input type="text" size="5" name="diastolic" id="diastolic_O4EBN" class="input_btline width120 x-form-invalid" onchange="onXYChange(constriction_O4EBN,diastolic_O4EBN)" value="舒张压" onkeyup="value=this.value.replace(/[^0-9]/g,'')"
                        onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="舒张压(mmHg)为必填项">
                    </td>
                    <td align="center" style="font-weight:bold;"><strong style="font-weight:bold;">2周内是否需要增加随访</strong></td>
                    <td>
                        <div id="div_addVisit2Week_O4EBN">
                            <label>
                                <input type="radio" value="1" id="addVisit2Week_y_O4EBN" name="addVisit2Week_O4EBN"><font>是&nbsp;</font></label>&nbsp;
                            <label>
                                <input type="radio" value="2" id="addVisit2Week_n_O4EBN" name="addVisit2Week_O4EBN"><font>否&nbsp;</font></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">身高(cm)</td>
                    <td colspan="1">
                        <input type="text" name="height" id="height_O4EBN" class="input_btline width120" value="身高" onkeyup="value=this.value.replace(/[^0-9.]/g,'')" onafterpaste="value=this.value.replace(/[^0-9.]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999';}" style="color:#999" title="身高(cm)">
                    </td>
                    <td align="center"><strong style="font-weight:bold;">ASCVD划分</strong></td>
                    <td>
                        <label>
                            <input type="radio" value="1" id="ASCVDGrade_1_O4EBN" name="ASCVDGrade_O4EBN" disabled=""><font id="F_ASCVDGrade_1_O4EBN" style="font-weight: normal; color: black;">一级预防&nbsp;</font></label>&nbsp;
                        <label>
                            <input type="radio" value="2" id="ASCVDGrade_2_O4EBN" name="ASCVDGrade_O4EBN" disabled=""><font id="F_ASCVDGrade_2_O4EBN" style="font-weight: normal; color: black;">二级预防</font></label>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">体重(kg)</td>
                    <td colspan="1">
                        <input type="text" name="weight" id="weight_O4EBN" class="input_btline width120" value="当前体重" onkeyup="value=this.value.replace(/[^0-9.]/g,'')" onafterpaste="value=this.value.replace(/[^0-9.]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999';}" style="color:#999" title="体重(kg)">/
                        <input type="text" name="targetWeight" id="targetWeight_O4EBN" class="input_btline width120" value="目标体重" onkeyup="value=this.value.replace(/[^0-9.]/g,'')" onafterpaste="value=this.value.replace(/[^0-9.]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="目标体重(kg)">
                    </td>
                    <td align="center"><strong style="font-weight:bold;">ASCVD风险判定</strong></td>
                    <td>
                        <label>
                            <input type="radio" value="1" id="ASCVDRiskAssess_1_O4EBN" name="ASCVDRiskAssess_O4EBN" disabled=""><font id="F_ASCVDRiskAssess_1_O4EBN" style="font-weight: normal; color: black;">低危&nbsp;</font></label>&nbsp;
                        <label>
                            <input type="radio" value="2" id="ASCVDRiskAssess_2_O4EBN" name="ASCVDRiskAssess_O4EBN" disabled=""><font id="F_ASCVDRiskAssess_2_O4EBN" style="font-weight: normal; color: black;">中危&nbsp;</font></label>&nbsp;
                        <label>
                            <input type="radio" value="3" id="ASCVDRiskAssess_3_O4EBN" name="ASCVDRiskAssess_O4EBN" disabled=""><font id="F_ASCVDRiskAssess_3_O4EBN" style="font-weight: normal; color: black;">高危&nbsp;</font></label>&nbsp;
                        <label>
                            <input type="radio" value="4" id="ASCVDRiskAssess_4_O4EBN" name="ASCVDRiskAssess_O4EBN" disabled=""><font id="F_ASCVDRiskAssess_4_O4EBN" style="font-weight: normal; color: black;">极高危&nbsp;</font></label>&nbsp;
                        <label>
                            <input type="radio" value="5" id="ASCVDRiskAssess_5_O4EBN" name="ASCVDRiskAssess_O4EBN" disabled=""><font id="F_ASCVDRiskAssess_5_O4EBN" style="font-weight: normal; color: black;">超高危</font></label>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">体质指数</td>
                    <td colspan="3">
                        <input type="text" id="bmi_O4EBN" class="input_btline width120" value="当前体质指数" disabled="true" onclick="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999"
                        title="BMI">/
                        <input type="text" id="targetBmi_O4EBN" class="input_btline width120" value="目标体质指数" disabled="true" onclick="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}"
                        style="color:#999" title="目标BMI">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">心率</td>
                    <td colspan="3">
                        <input type="text" name="heartRate" id="heartRate_O4EBN" class="input_btline width120 x-form-invalid" value="当前心率" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="心率为必填项">
                        <input style="display: none; color: rgb(0, 0, 0);" type="text" name="targetHeartRate" id="targetHeartRate_O4EBN" class="input_btline widt80" value="目标心率" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')"
                        onclick="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}" title="目标心率">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">其他</td>
                    <td colspan="3">
                        <input name="otherSigns" id="otherSigns_O4EBN" type="text" class="input_btline" size="60" title="其它体征" style="color: rgb(0, 0, 0);">
                    </td>
                </tr>
                <tr>
                    <td rowspan="6" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">生活指导方式</strong></td>
                    <td align="center" style="font-weight:bold;">日吸烟量（支）</td>
                    <td colspan="3">
                        <input type="text" name="smokeCount" id="smokeCount_O4EBN" class="input_btline width120 x-form-invalid" value="当前日吸烟量" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="日吸烟量(支)为必填项">/
                        <input type="text" name="targetSmokeCount" id="targetSmokeCount_O4EBN" class="input_btline width120" value="目标日吸烟量" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="目标量(支)">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">日饮酒量（两）</td>
                    <td colspan="3">
                        <input type="text" name="drinkCount" id="drinkCount_O4EBN" class="input_btline width120" value="当前日饮酒量" onkeyup="value=this.value.replace(/[^0-9.]/g,'')" onafterpaste="value=this.value.replace(/[^0-9.]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999';}" style="color:#999" title="日饮酒量(两)">/
                        <input type="text" name="targetDrinkCount" id="targetDrinkCount_O4EBN" class="input_btline width120" value="目标日饮酒量" onkeyup="value=this.value.replace(/[^0-9.]/g,'')" onafterpaste="value=this.value.replace(/[^0-9.]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999';}" style="color:#999" title="目标量(两)">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">运动</td>
                    <td colspan="3">
                        <input type="text" name="trainTimesWeek" id="trainTimesWeek_O4EBN" class="input_btline x-form-invalid" value="当前次数" size="5" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="周运动次数为必填项">次/周
                        <input type="text" name="trainMinute" id="trainMinute_O4EBN" class="input_btline x-form-invalid" value="当前时长" size="5" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="每次时长(分)为必填项">分钟/次&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="text" name="targetTrainTimesWeek" id="targetTrainTimesWeek_O4EBN" class="input_btline" value="目标次数" size="5" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')"
                        onclick="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="目标次数">次/周
                        <input type="text" name="targetTrainMinute" id="targetTrainMinute_O4EBN" class="input_btline" value="目标时长" size="5" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')" onclick="if(value==defaultValue){value='';this.style.color='#000'}"
                        onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" title="目标时长(分)">分钟/次</td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">摄盐情况（咸淡）</td>
                    <td colspan="2">
                        <label>
                            <input type="radio" value="1" name="salt_O4EBN" onclick="check(this)"><font>轻&nbsp;</font></label>
                        <label>
                            <input type="radio" value="2" name="salt_O4EBN" onclick="check(this)"><font>中&nbsp;</font></label>
                        <label>
                            <input type="radio" value="3" name="salt_O4EBN" onclick="check(this)"><font>重&nbsp;/目标值：</font></label>
                        <label>
                            <input type="radio" value="1" name="targetSalt_O4EBN" onclick="check(this)"><font>轻&nbsp;</font></label>
                        <label>
                            <input type="radio" value="2" name="targetSalt_O4EBN" onclick="check(this)"><font>中&nbsp;</font></label>
                        <label>
                            <input type="radio" value="3" name="targetSalt_O4EBN" onclick="check(this)"><font>重&nbsp;</font></label>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">心理调整</td>
                    <td colspan="3">
                        <label>
                            <input type="radio" value="1" name="psychologyChange_O4EBN" onclick="check(this)"><font>良好&nbsp;</font></label>
                        <label>
                            <input type="radio" value="2" name="psychologyChange_O4EBN" onclick="check(this)"><font>一般&nbsp;</font></label>
                        <label>
                            <input type="radio" value="3" name="psychologyChange_O4EBN" onclick="check(this)"><font>差&nbsp;</font></label>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">遵医行为</td>
                    <td colspan="3">
                        <label>
                            <input type="radio" value="1" name="obeyDoctor_O4EBN" onclick="check(this)"><font>良好&nbsp;</font></label>
                        <label>
                            <input type="radio" value="2" name="obeyDoctor_O4EBN" onclick="check(this)"><font>一般&nbsp;</font></label>
                        <label>
                            <input type="radio" value="3" name="obeyDoctor_O4EBN" onclick="check(this)"><font>差&nbsp;</font></label>
                    </td>
                </tr>
                <tr>
                    <td rowspan="5" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">辅助检查</strong></td>
                    <td align="center" style="font-weight:bold;color:blue">总胆固醇</td>
                    <td colspan="3">
                        <input type="text" name="tc" class="input_btline" id="tc_O4EBN" value="" title="总胆固醇(mmol/L)">mmol/L</td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue">甘油三酯</td>
                    <td colspan="3">
                        <input type="text" name="tg" class="input_btline" id="tg_O4EBN" value="" title="甘油三酯(mmol/L)">mmol/L</td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue">血清LDL-C</td>
                    <td colspan="3">
                        <input type="text" name="ldl" class="input_btline" id="ldl_O4EBN" value="" title="血清LDL-C(mmol/L)">mmol/L</td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue">血清HDL-C</td>
                    <td colspan="3">
                        <input type="text" name="hdl" class="input_btline" id="hdl_O4EBN" value="" title="血清HDL-C(mmol/L)">mmol/L</td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">其他</td>
                    <td colspan="3">
                        <input type="text" name="auxiliaryCheck" class="input_btline" id="auxiliaryCheck_O4EBN" size="60" title="辅助检查">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">服药依从性</strong></td>
                    <td colspan="3">
                        <div id="div_medicine_O4EBN" class=" x-form-invalid" title="服药依从性为必填项">
                            <label>
                                <input type="radio" value="1" id="medicine_gl_O4EBN" name="medicine_O4EBN" onclick="onMedicineClick(value,medicineBadEffectText_O4EBN)"><font>规律&nbsp;</font></label>
                            <label>
                                <input type="radio" value="2" id="medicine_jd_O4EBN" name="medicine_O4EBN" onclick="onMedicineClick(value,medicineBadEffectText_O4EBN)"><font>间断&nbsp;</font></label>
                            <label>
                                <input type="radio" value="3" id="medicine_bfy_O4EBN" name="medicine_O4EBN" onclick="onMedicineClick(value,medicineBadEffectText_O4EBN)"><font>不服药</font></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">药物不良反应</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="radio" value="n" id="medicineBadEffect_n_O4EBN" name="medicineBadEffect_O4EBN" onclick="onMedicineBadEffectChange(value, medicineBadEffectText_O4EBN)"><font>无&nbsp;</font></label>
                        <label>
                            <input type="radio" value="y" id="medicineBadEffect_y_O4EBN" name="medicineBadEffect_O4EBN" onclick="onMedicineBadEffectChange(value, medicineBadEffectText_O4EBN)"><font>有&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;不良反应:</font></label>
                        <input type="text" class="input_btline" id="medicineBadEffectText_O4EBN" size="35" title="不良反应">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">此次随访分类</strong></td>
                    <td colspan="3">
                        <div id="div_visitEvaluate_O4EBN" class=" x-form-invalid" title="随访分类为必填项">
                            <label>
                                <input type="radio" onclick="check(this)" value="1" name="visitEvaluate_O4EBN"><font>控制满意&nbsp;</font></label>
                            <label>
                                <input type="radio" onclick="check(this)" value="2" name="visitEvaluate_O4EBN"><font>控制不满意&nbsp;</font></label>
                            <label>
                                <input type="radio" onclick="check(this)" value="3" name="visitEvaluate_O4EBN"><font>不良反应&nbsp;</font></label>
                            <label>
                                <input type="radio" onclick="check(this)" value="4" name="visitEvaluate_O4EBN"><font>并发症</font></label>
                        </div>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">健康处方建议</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="checkbox" value="1-1" name="healthProposal_O4EBN">去医院确定治疗方案&nbsp;</label>
                        <label>
                            <input type="checkbox" value="1-2" name="healthProposal_O4EBN">坚持按医嘱服药&nbsp;</label>
                        <label>
                            <input type="checkbox" value="1-3" name="healthProposal_O4EBN">需要调整方案&nbsp;</label>
                        <label>
                            <input type="checkbox" value="1-4" name="healthProposal_O4EBN">去医院进一步确诊&nbsp;</label>
                        <label>
                            <input type="checkbox" value="2-1" name="healthProposal_O4EBN">定期测量血压&nbsp;</label>
                        <label>
                            <input type="checkbox" value="2-2" name="healthProposal_O4EBN">增加测量血压频率&nbsp;</label>
                        <label>
                            <input type="checkbox" value="2-3" name="healthProposal_O4EBN">接受技能指导&nbsp;</label>
                        <label>
                            <input type="checkbox" value="3-1" name="healthProposal_O4EBN">阅读发放的宣传材料&nbsp;</label>
                        <label>
                            <input type="checkbox" value="4-1" name="healthProposal_O4EBN">限制烟量或戒烟&nbsp;</label>
                        <label>
                            <input type="checkbox" value="4-2" name="healthProposal_O4EBN">戒烟&nbsp;</label>
                        <label>
                            <input type="checkbox" value="4-3" name="healthProposal_O4EBN">避免被动吸烟&nbsp;</label>
                        <label>
                            <input type="checkbox" value="5-1" name="healthProposal_O4EBN">减少或不要饮酒&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6-1" name="healthProposal_O4EBN">限钠盐(＜1斤/3人*月)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6-2" name="healthProposal_O4EBN">减少脂肪食品摄入&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6-3" name="healthProposal_O4EBN">增加鱼、禽、奶制品摄入&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6-4" name="healthProposal_O4EBN">增加新鲜水果蔬菜摄入&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6-5" name="healthProposal_O4EBN">减少谷类，面制品摄入&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7-1" name="healthProposal_O4EBN">开始低强度的运动&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7-2" name="healthProposal_O4EBN">接受技能指导&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7-3" name="healthProposal_O4EBN">逐步增加运动强度或延长运动时间&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7-4" name="healthProposal_O4EBN">逐步减少运动强度或缩短运动时间&nbsp;</label>
                        <label>
                            <input type="checkbox" value="8-1" name="healthProposal_O4EBN">放松心情，调节睡眠，注意休息&nbsp;</label>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">危险因素</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="checkbox" value="1" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">男性＞55 岁或女性＞65 岁&nbsp;</label>
                        <label>
                            <input type="checkbox" value="2" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">吸烟&nbsp;</label>
                        <label>
                            <input type="checkbox" value="3" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">糖耐量受损&nbsp;</label>
                        <label>
                            <input type="checkbox" value="4" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">血脂异常;TC≥5.7mmol/L(220mg/dL);或LDL-C＞3.6mmol/L(140mg/dL);或HDL-C＜1.0mmol/L(40mg/dL)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="5" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">早发心血管病家族史(一级亲属发病年龄男性小于55岁，女性小于65岁)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">腹型肥胖&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">血同型半胱氨酸升高&nbsp;</label>
                        <label>
                            <input type="checkbox" value="8" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">糖尿病伴微白蛋白尿&nbsp;</label>
                        <label>
                            <input type="checkbox" value="9" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">以静息为主的生活方式&nbsp;</label>
                        <label>
                            <input type="checkbox" value="10" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">血浆纤维蛋白原增高&nbsp;</label>
                        <label>
                            <input type="checkbox" value="11" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">高敏C反应蛋白≥3mg/L或C反应蛋白≥10mg/L&nbsp;</label>
                        <label>
                            <input type="checkbox" value="12" name="riskiness_O4EBN" onclick="onRiskinessClick(value)">无&nbsp;</label>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">并发症</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="checkbox" value="1" name="complication_O4EBN" onclick="onComplicationClick(value)">缺血性卒中&nbsp;</label>
                        <label>
                            <input type="checkbox" value="2" name="complication_O4EBN" onclick="onComplicationClick(value)">脑出血&nbsp;</label>
                        <label>
                            <input type="checkbox" value="3" name="complication_O4EBN" onclick="onComplicationClick(value)">短暂性脑缺血发作(TIA)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="4" name="complication_O4EBN" onclick="onComplicationClick(value)">心肌梗死&nbsp;</label>
                        <label>
                            <input type="checkbox" value="5" name="complication_O4EBN" onclick="onComplicationClick(value)">心绞痛&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6" name="complication_O4EBN" onclick="onComplicationClick(value)">冠状动脉血运重建史&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7" name="complication_O4EBN" onclick="onComplicationClick(value)">慢性心力衰竭&nbsp;</label>
                        <label>
                            <input type="checkbox" value="8" name="complication_O4EBN" onclick="onComplicationClick(value)">充血性心力衰竭&nbsp;</label>
                        <label>
                            <input type="checkbox" value="9" name="complication_O4EBN" onclick="onComplicationClick(value)">糖尿病肾病&nbsp;</label>
                        <label>
                            <input type="checkbox" value="10" name="complication_O4EBN" onclick="onComplicationClick(value)">肾功能衰竭(血肌酐:男性&gt;=1.5mg/dl,女性&gt;=1.4mg.dl,蛋白尿&gt;=300mg/24h)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="11" name="complication_O4EBN" onclick="onComplicationClick(value)">外周血管疾病&nbsp;</label>
                        <label>
                            <input type="checkbox" value="12" name="complication_O4EBN" onclick="onComplicationClick(value)">视网膜病变(出血或渗出，视乳头水肿)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="13" name="complication_O4EBN" onclick="onComplicationClick(value)">糖尿病&nbsp;</label>
                        <label>
                            <input type="checkbox" value="14" name="complication_O4EBN" onclick="onComplicationClick(value)">夹层动脉瘤&nbsp;</label>
                        <label>
                            <input type="checkbox" value="15" name="complication_O4EBN" onclick="onComplicationClick(value)">症状性动脉疾病&nbsp;</label>
                        <label>
                            <input type="checkbox" value="16" name="complication_O4EBN" onclick="onComplicationClick(value)">以上都无&nbsp;</label>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">靶器官损害</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="checkbox" value="1" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">左心室肥厚(心电图、超声心动图或X线)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="2" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">颈动脉超声IMT&gt;=0.9mm或动脉粥样斑块;超声或X线证实有动脉粥样斑块(颈、髂、股或主动脉)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="3" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">颈-股动脉搏波速度 ＞12m/s&nbsp;</label>
                        <label>
                            <input type="checkbox" value="4" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">踝/臂血压指数 ＜ 0.9&nbsp;</label>
                        <label>
                            <input type="checkbox" value="5" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">eGFR降低或血清肌酐轻度升高&nbsp;</label>
                        <label>
                            <input type="checkbox" value="6" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">微量白蛋白尿&nbsp;</label>
                        <label>
                            <input type="checkbox" value="7" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">白蛋白/肌酐比:男性≥22mg/g(2.5mg/mmol)女性≥31mg/g(3.5mg/mmol)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="8" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">蛋白尿和／或血浆肌酐浓度轻度升高 106～177μmol／L(1.2～2.0mg/dl)&nbsp;</label>
                        <label>
                            <input type="checkbox" value="9" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">视网膜普遍或灶性动脉狭窄&nbsp;</label>
                        <label>
                            <input type="checkbox" value="10" name="targetHurt_O4EBN" onclick="onTargetHurtClick(value)">以上都无&nbsp;</label>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">原并发症加重</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="radio" value="y" name="complicationIncrease_O4EBN">是&nbsp;</label>
                        <label>
                            <input type="radio" value="n" name="complicationIncrease_O4EBN">否&nbsp;</label>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">危险分层</strong></td>
                    <td colspan="3">
                        <label>
                            <input type="radio" value="1" name="riskLevel_O4EBN" disabled="">低危&nbsp;</label>
                        <label>
                            <input type="radio" value="2" name="riskLevel_O4EBN" disabled="">中危&nbsp;</label>
                        <label>
                            <input type="radio" value="3" name="riskLevel_O4EBN" disabled="">高危&nbsp;</label>
                        <label>
                            <input type="radio" value="4" name="riskLevel_O4EBN" disabled="">很高危&nbsp;</label>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td rowspan="8" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">用药情况</strong></td>
                    <td align="center" style="font-weight:bold;">药物名称1</td>
                    <td colspan="3">
                        <div id="div_drugNames1_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1490" style="width: 0px;">
                                <input type="text" size="24" autocomplete="off" id="ext-comp-1256" name="drugNames0_O4EBN" class="x-form-text x-form-field" style="width: 412px;"><img src="" alt="" class="x-form-trigger x-form-arrow-trigger" id="ext-gen1491" style="display: none;"></div>
                        </div>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">用法用量</td>
                    <td>每日
                        <input type="text" id="everyDayTime1_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">次</td>
                    <td>每次
                        <input type="text" id="oneDosage1_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">
                        <input type="text" id="medicineUnit1_O4EBN" class="input_btline2" size="2" disabled="true">
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">药物名称2</td>
                    <td colspan="3">
                        <div id="div_drugNames2_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1516" style="width: 0px;">
                                <input type="text" size="24" autocomplete="off" id="ext-comp-1270" name="drugNames1_O4EBN" class="x-form-text x-form-field" style="width: 412px;"><img src="" alt="" class="x-form-trigger x-form-arrow-trigger" id="ext-gen1517" style="display: none;"></div>
                        </div>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">用法用量</td>
                    <td>每日
                        <input type="text" id="everyDayTime2_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">次</td>
                    <td>每次
                        <input type="text" id="oneDosage2_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">
                        <input type="text" id="medicineUnit2_O4EBN" class="input_btline2" size="2" disabled="true">
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">药物名称3</td>
                    <td colspan="3">
                        <div id="div_drugNames3_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1542" style="width: 0px;">
                                <input type="text" size="24" autocomplete="off" id="ext-comp-1284" name="drugNames2_O4EBN" class="x-form-text x-form-field" style="width: 412px;"><img src="" alt="" class="x-form-trigger x-form-arrow-trigger" id="ext-gen1543" style="display: none;"></div>
                        </div>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">用法用量</td>
                    <td>每日
                        <input type="text" id="everyDayTime3_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">次</td>
                    <td>每次
                        <input type="text" id="oneDosage3_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">
                        <input type="text" id="medicineUnit3_O4EBN" class="input_btline2" size="2" disabled="true">
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">其他药物</td>
                    <td colspan="3">
                        <div id="div_drugNames4_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1568" style="width: 0px;">
                                <input type="text" size="24" autocomplete="off" id="ext-comp-1298" name="drugNames3_O4EBN" class="x-form-text x-form-field" style="width: 412px;"><img src="" alt="" class="x-form-trigger x-form-arrow-trigger" id="ext-gen1569" style="display: none;"></div>
                        </div>
                    </td>
                </tr>
                <tr style="display: none;">
                    <td align="center" style="font-weight:bold;">用法用量</td>
                    <td>每日
                        <input type="text" id="everyDayTime4_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">次</td>
                    <td>每次
                        <input type="text" id="oneDosage4_O4EBN" class="input_btline widt80" onkeyup="value=this.value.replace(/[^0-9]/g,'')" onafterpaste="value=this.value.replace(/[^0-9]/g,'')">
                        <input type="text" id="medicineUnit4_O4EBN" class="input_btline2" size="2" disabled="true">
                    </td>
                </tr>
                <tr>
                    <td rowspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">转诊</strong></td>
                    <td align="center" style="font-weight:bold;">原因</td>
                    <td colspan="3">
                        <input type="text" name="referralReason" class="input_btline" id="referralReason_O4EBN" size="60" title="转诊原因" style="color: rgb(0, 0, 0);">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;">机构及科别</td>
                    <td colspan="3">
                        <input type="text" name="agencyAndDept" class="input_btline" id="agencyAndDept_O4EBN" size="60" title="机构及科别" style="color: rgb(0, 0, 0);">
                    </td>
                </tr>
                <tr>
                    <td rowspan="10" align="center" style="font-weight:bold;"><strong style="font-weight:bold;color:blue">糖尿病</strong></td>
                </tr>
                <tr></tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue">是否糖尿病</td>
                    <td colspan="3">
                        <div id="div_isdiabetes_O4EBN">
                            <label>
                                <input type="radio" value="1" onclick="check(this)" name="isdiabetes_O4EBN"><font>是&nbsp;</font></label>
                            <label>
                                <input type="radio" value="2" onclick="check(this)" name="isdiabetes_O4EBN"><font>否&nbsp;</font></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue">足背动脉搏动</td>
                    <td colspan="3" id="pulsation_O4EBN">
                        <label>
                            <input type="radio" id="pulsation_5_O4EBN" name="pulsation_O4EBN" value="5" onclick="check(this)"><font>触及正常&nbsp;</font></label>
                        <label>
                            <input type="radio" id="pulsation_2_O4EBN" name="pulsation_O4EBN" value="2" onclick="check(this)"><font>双侧减弱&nbsp;</font></label>
                        <label>
                            <input type="radio" id="pulsation_3_O4EBN" name="pulsation_O4EBN" value="3" onclick="check(this)"><font>左侧减弱&nbsp;</font></label>
                        <label>
                            <input type="radio" id="pulsation_4_O4EBN" name="pulsation_O4EBN" value="4" onclick="check(this)"><font>右侧减弱&nbsp;</font></label>
                        <label>
                            <input type="radio" id="pulsation_1_O4EBN" name="pulsation_O4EBN" value="1" onclick="check(this)"><font>双侧消失&nbsp;</font></label>
                        <label>
                            <input type="radio" id="pulsation_6_O4EBN" name="pulsation_O4EBN" value="6" onclick="check(this)"><font>左侧消失&nbsp;</font></label>
                        <label>
                            <input type="radio" id="pulsation_7_O4EBN" name="pulsation_O4EBN" value="7" onclick="check(this)"><font>右侧消失</font></label>
                    </td>
                </tr>
                <tr>
                    <td align="center"> <span id="ZS_O4EBN"><strong style="font-weight:bold;color:blue">主食（克/天）</strong></span> </td>
                    <td colspan="3">
                        <input type="text" name="food" id="food_O4EBN" class="input_btline widt80" value="0" title="主食(克/天)" style="color: rgb(153, 153, 153);"> /
                        <input type="text" name="targetFood" id="targetFood_O4EBN" class="input_btline widt80" value="0" title="目标(克/天)" style="color: rgb(153, 153, 153);">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue"><span id="KFXT_O4EBN">空腹血糖值</span></td>
                    <td colspan="3">
                        <input type="text" id="fbs_O4EBN" name="fbs" class="input_btline" value="" title="空腹血糖">mmol/L
                        <input style="display: none;" type="radio" name="fbsTest_O4EBN" value="1" onclick="check(this)">
                        <input style="display: none;" type="radio" name="fbsTest_O4EBN" value="2" onclick="check(this)">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;color:blue"><span id="CHXT_O4EBN">餐后血糖值</span></td>
                    <td colspan="3">
                        <input type="text" id="pbs_O4EBN" name="pbs" class="input_btline" value="" disabled="true" title="餐后血糖">mmol/L
                        <input style="display: none;" type="radio" name="pbsTest" id="pbsTest_O4EBN" value="1" onclick="check(this)">
                        <input style="display: none;" type="radio" name="pbsTest" id="pbsTest_O4EBN" value="2" onclick="check(this)">
                    </td>
                </tr>
                <tr>
                    <td align="center" style="font-weight:bold;"><strong style="font-weight:bold;color:blue">低血糖反应</strong></td>
                    <td colspan="3" id="glycopenia__O4EBN">
                        <label>
                            <input type="radio" name="glycopenia_O4EBN" value="1" onclick="check(this)"><font>无&nbsp;</font></label>
                        <label>
                            <input type="radio" name="glycopenia_O4EBN" value="2" onclick="check(this)"><font>偶尔&nbsp;</font></label>
                        <label>
                            <input type="radio" name="glycopenia_O4EBN" value="3" onclick="check(this)"><font>频繁&nbsp;</font></label>
                    </td>
                </tr>
                <tr>
                    <td colspan="1" align="center" style="font-weight:bold;"><strong style="font-weight:bold;color:blue">糖尿病随访分类</strong></td>
                    <td colspan="3">
                        <div id="div_diabetesVisitEvaluate_O4EBN">
                            <label>
                                <input type="radio" value="1" onclick="check(this)" name="diabetesVisitEvaluate_O4EBN"><font>控制满意&nbsp;</font></label>
                            <label>
                                <input type="radio" value="2" onclick="check(this)" name="diabetesVisitEvaluate_O4EBN"><font>控制不满意&nbsp;</font></label>
                            <label>
                                <input type="radio" value="3" onclick="check(this)" name="diabetesVisitEvaluate_O4EBN"><font>不良反应&nbsp;</font></label>
                            <label>
                                <input type="radio" value="4" onclick="check(this)" name="diabetesVisitEvaluate_O4EBN"><font>并发症&nbsp;</font></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="1" rowspan="1" align="center" style="font-weight:bold;"><strong style="font-weight:bold;color:blue">服药依从性</strong></td>
                    <td colspan="3">
                        <div id="div_diabetesMedicine_O4EBN">
                            <label>
                                <input type="radio" id="diabetesMedicine_gl_O4EBN" value="1" onclick="check(this)" name="diabetesMedicine_O4EBN"><font>规律&nbsp;</font></label>
                            <label>
                                <input type="radio" id="diabetesMedicine_jd_O4EBN" value="2" onclick="check(this)" name="diabetesMedicine_O4EBN"><font>间断&nbsp;</font></label>
                            <label>
                                <input type="radio" id="diabetesMedicine_bfy_O4EBN" value="3" onclick="check(this)" name="diabetesMedicine_O4EBN"><font>不服药&nbsp;</font></label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">下次随访日期</strong></td>
                    <td colspan="3">
                        <div id="div_nextDate_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1478" style="width: 310px;">
                                <input type="text" size="10" autocomplete="off" id="ext-comp-1253" name="nextDate_O4EBN" class="x-form-text x-form-field" style="width: 285px;"><img src="" alt="" class="x-form-trigger x-form-date-trigger" id="ext-gen1479"></div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" style="font-weight:bold;"><strong style="font-weight:bold;">随访医生</strong></td>
                    <td colspan="3">
                        <div id="div_visitDoctor_O4EBN">
                            <div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen1481" style="width: 310px;">
                                <input type="text" size="24" autocomplete="off" id="ext-comp-1255" name="ext-comp-1255" class="x-form-text x-form-field" style="width: 285px;"><img src="" alt="" class="x-form-trigger undefined" id="ext-gen1482"></div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</form>



      </body>
      </html>
    `);
  });

// API 路由
app.get('/data', (req, res) => {
    const idCard = req.query.idCard;
    const data = healthData[idCard];

    if (data) {
        res.json(data); // 返回对应的健康数据
    } else {
        res.status(404).json({ message: 'Data not found' }); // 找不到数据时返回404
    }
});
app.get('/user', (req, res) => {
    console.log(req.query)
    const idCard = req.query.idCard;
    const data = data_list[idCard];
    if (data) {
        res.json({...req.query, data}); // 返回对应的健康数据
    } else {
        res.status(404).json({ message: 'Data not found' }); // 找不到数据时返回404
    }
})


// 启动服务器
app.listen(PORT, () => {
    console.log(`Server is running on http://localhost:${PORT}`);
});